/***************************************************
 @Name :        小铭同学
 @Time :        2025-09-03
 @Email :       LiaoMingWJ233@163.com
 @Comment :     蜂鸣器 控制
 @FileName :    beepdevice.cpp
 @Version :     1.0
****************************************************/


#include "beepdevice.h"

beepdevice::beepdevice(QObject *parent) : QObject(parent)
{
    beep_init();
}

int beepdevice::beepOn(){
    int ret;
    ret = beep_on();
    if(ret<0)
    {
     perror("open led failed\n");
    }
    return ret;
}

int beepdevice::beepOff(){
    int ret;
    ret = beep_off();
    if(ret<0)
    {
      perror("open led failed\n");
    }
    return ret;
}

int beepdevice::setPwm(int value){
    int ret;
    ret = set_pwm(value);
    if(ret<0)
    {
      perror("open led failed\n");
    }
    return ret;
}

beepdevice::~beepdevice(){
    beep_close();
}

